
# 12. 输入一行字符，分别统计出其中英文字母、空格、数字和其它字符的个数。
my_str = "ghfsjdhkfl^&*()45678FHGJksff j7 6 84 48432GJHJKHKHHK"
letter = 0
space = 0
number = 0
other = 0
for x in my_str:
    if x.isalpha():
        letter += 1
        continue
    if x.isdigit():
        number += 1
        continue
    if x.isspace():
        space += 1
        continue
    other += 1

print("字母总数:{}".format(letter))
print("数字总数:{}".format(number))
print("空格总数:{}".format(space))
print("其它字符总数:{}".format(other))

